package com.study.config;

import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

/***
 * @description 异步调用异常捕获处理
 * @author hw
 * @date 2020/8/26 10:07:51
 */
public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler {

    /***
     * @description 异常处理方法(无返回值)
     * @author hw
     * @date 2020/8/26 10:08:58
     * @param throwable:
     * @param method:
     * @param obj:
     */
    @Override
    public void handleUncaughtException(Throwable throwable, Method method, Object... obj) {
        System.out.println("Exception message - " + throwable.getMessage());
        System.out.println("Method name - " + method.getName());
        for (Object param : obj) {
            System.out.println("Parameter value - " + param);
        }
    }
}

